package com.sc.nft.entity.vo;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.enums.JumpTypeEnum;
import com.sc.nft.enums.JumpTypeSeflAmmunitionEnum;
import com.sc.nft.enums.SelfTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
public class SelfAmmunitionPageVO {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "名称")
    private String selfAmmunitionName;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "引导图")
    private String selfAmmunitionImg;

    @ApiModelProperty(value = "跳转类型（SELF_APP：app、SELF_H5：H5）")
    private JumpTypeEnum jumpType;

    @ApiModelProperty(value = "跳转页面")
    private String jumpUrl;

    @ApiModelProperty(value = "跳转页面Id")
    private JumpTypeSeflAmmunitionEnum jumpId;

    @ApiModelProperty(value = "活动id")
    private Long activityId;

    @ApiModelProperty(value = "活动名称")
    private String activityName;

    @ApiModelProperty(value = "状态（0：未上架，1：上架)")
    private Boolean isListing;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date selfAmmunitionStartTime;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date selfAmmunitionEndTime;

    @ApiModelProperty(value = "id")
    private Integer sort;

    @ApiModelProperty(value = "自弹类型（EVERY_DAY_LOGIN每日每次登录）")
    private SelfTypeEnum selfType;

    @ApiModelProperty(value = "自弹类型名称")
    private String selfName;

    public void setSelfType(Integer selfType) {
        SelfTypeEnum code = SelfTypeEnum.getCode(selfType);
        this.selfType = code;
        this.selfName = code.getDesc();
    }

    public void setJumpType(Integer jumpType) {
        this.jumpType = JumpTypeEnum.getCode(jumpType);
    }

}